import { Component, OnInit } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';

import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';

import { AppService } from '../../services/app.service';
import { Router } from '@angular/router';
import { first } from 'rxjs';

import { HeaderAdminComponent } from '../../modules/header-admin/header-admin.component';
import { SidebarComponent } from '../../modules/sidebar/sidebar.component'; 
@Component({
  selector: 'app-admin-page',
  standalone: true,
  imports: [HeaderAdminComponent,RouterModule,
    FormsModule,
    ReactiveFormsModule,
    CommonModule,
    HttpClientModule,SidebarComponent,],
  templateUrl: './admin-page.component.html',
  styleUrl: './admin-page.component.scss'
})
export class AdminPageComponent implements OnInit {

  constructor(private fb: FormBuilder, private appService: AppService, private route: Router) {
   
  }
  async ngOnInit(){
   
  }
  
  async nextPages() {
    this.route.navigate(['/add-plugins']);
    await this.delay(10);
    window.location.reload();
  }
  private delay(ms: number): Promise<void> {
    return new Promise(resolve => setTimeout(resolve, ms));
  }
}
